// JavaScript Document
window.onload=function(){
	var sBox = $('#Search');  //获取搜索部分
	var sInput = $('#Search_Box');  //获取搜索输入框
	var flagInput = false;  //用于判断焦点是否在输入框内
	var infoDiv = $('.Info_Li');  //获取文章列表
	var infoImg = $('.Info_Li img');  //获取文章列表图片
	var selectBtn = $('#Select_Btn');
	var selectAll = $('#Select_All');
	infoDiv.mouseover(function(){this.style.backgroundColor='#EDF8F5';})
	infoDiv.mouseout(function(){this.style.backgroundColor='#d8f0f6';})
	infoImg.mouseover(function(){this.style.border='1px solid #39F';})
	infoImg.mouseout(function(){this.style.border='1px solid #CCC';})
	/*$("#Info_Box").jscroll({W:"10px",
							Bg:"#cfedf4",
							Bar:{Bd:{Out:'#FFF',Hover:"#e8fbff",Focus:"#91d3e2"}//设置滚动滚轴边框颜色：鼠标离开(默认)，经过
								,Bg:{Out:"#FFF",Hover:"#e8fbff",Focus:"#91d3e2"}},//设置滚动条滚轴背景：鼠标离开(默认)，经过，点击
							Btn:{btn:false}});*/
	selectBtn.click(function(){  //换花样函数
		if(selectAll.css('height')=='55px')
			selectAll.stop(true).animate({height:'203px'},'fast');
		else
			selectAll.stop(true).animate({height:'55px'},'fast');
		})
	sBox.mouseover(function(){  //搜索框的滑出
		sBox.stop(true).animate({width:'260px'},'fast');
		sInput.stop(true).animate({width:'150px'},"fast");
		});
	sBox.mouseleave(backBox);
	function backBox(){  //搜索框的回撤
		//alert(!sInput[0].isFocused)
		if(!flagInput)
		{
			sBox.stop(true).animate({width:'120px'},'normal');
			sInput.stop(true).animate({width:'0px'},"normal");
			sInput.fadeOut(0);
		}
	}
	sInput.focus(function(){  //鼠标焦点对准搜索框
		sInput.css("color",'#000');
		if(sInput.val()=="搜索社团、文章、资源...")
			sInput.val("");
		flagInput = true ;
		});
	sInput.blur(function(){   //搜索框失焦
		sInput.css("color",'#CCC');
		if(sInput.val()=="")
			sInput.val("搜索社团、文章、资源...");
		flagInput = false ;
		backBox();
		});
}